home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / sgml / sgml2latex-format.1.3.tar.Z / sgml2latex-format.1.3.tar / rep / qwertz / latin1 / mapping < prev    next >
Text File  |  1993-03-12  |  9KB  |  547 lines

  1.  
  2. % qwertz replacement file
  3. % translates into nroff, using ms macros
  4. % manpages can be processed using the man macros
  5. % does not use neqn for math.
  6.  
  7. % Author:  Tom Gordon
  8.  
  9.  
  10. % Groff dependencies are few.  To port to another roff: 
  11. % 1. Check and modify, if necessary, font changes.  (e.g. In psroff the
  12. % same fonts have other names.)
  13. % 2. Check the code for including Encapsulated PostScript, generated
  14. % for eps elements.
  15. % 3. Also make versions of general.grops and math.grops, which are sed
  16. % scripts translating character entities into groff character references.
  17.  
  18.  
  19. <qwertz>    +    ".nr PS 11\n"
  20.  
  21.             ".nr PI 3n\n"
  22.             ".ds CF \\\\n\%\n"    
  23.             ".ds CH \\&\n"
  24.             ".ds dR $\n"   % dollar, to avoid EQN conflicts
  25.             
  26.             % Footnote style
  27.             ".nr FF 1\n"
  28.  
  29.             % James Clark's trick to prevent unintended paragraph
  30.             % breaks
  31.  
  32.             ".tr \\&\n"
  33.  
  34.             % horizontal line
  35.             ".de hl\n"
  36.             ".br\n"
  37.             "\\l'\\\\n(.lu-\\\\n(.iu'\n"
  38.             "..\n"
  39.  
  40.             % paragraph spacing
  41.             ".if n .nr PD 1v\n"
  42.             
  43.             % h is 1 if first paragraph after heading
  44.  
  45.             ".nr h 0\n" 
  46.  
  47.             % initialize heading level
  48.             
  49.             ".nr il 1\n"    
  50.  
  51.             % Number registers for list
  52.  
  53.             ".nr bi 0\n"  % initialize begin items
  54.             ".nr ll 0\n"  % list level, stores current level
  55.             ".nr el 0\n"  % current enumeration level
  56.  
  57.             % Not all list levels are enumerations, as 
  58.             % itemizations can be embedded within enumerations
  59.             % and vice versa
  60.             
  61.             % type of list level is in \n(t\n(ll, where
  62.             % 0 : itemize, 1 : enumerate, 2: description
  63.  
  64.             % enumerator for an enumeration level is in
  65.             % \n(e\n(el -- i.e. \n(e1=2 means current item of
  66.             % enumeration level 1 is 2
  67.             
  68.             % context-sensitive paragraph macro
  69.  
  70.  
  71. ".de Pp\n"
  72. ".ie \\\\n(ll>0 \\{\\\n"       % within list?
  73. ".ie \\\\n(bi=1 \\{\\\n"       % first par element of item?
  74. ".nr bi 0\n"             % reset bi flag
  75. % if itemization, mark with a bullet
  76. ".if \\\\n(t\\\\n(ll=0 \\{.IP \\\\(bu\\}\n" % itemize
  77. %  if enumeration: increment and print enumerator
  78. % for this enumeration level
  79. ".if \\\\n(t\\\\n(ll=1 \\{.IP \\\\n+(e\\\\n(el.\\}\n"
  80. % if first par element of descrip, do nothing
  81. ".\\}\n"  
  82. ".el .sp \n"            % subsequent par element of item
  83. ".\\}\n"
  84. ".el \\{\\\n"                 % not within list
  85. ".ie \\\\nh=1 \\{\\\n"        % first par after heading
  86. ".LP\n"    
  87. ".nr h 0\n"            % reset h flag
  88. ".\\}\n"            
  89. ".el .PP \n"   
  90. ".\\}\n"
  91. "..\n"    
  92.  
  93.             
  94.             
  95.             % for each level, a number register is created
  96.             % to store its type and current item number, where
  97.             % -1=bullet of an itemized list.
  98.  
  99.             % Format of list level enumerators
  100.  
  101.             ".ds f1 1\n"
  102.             ".ds f2 a\n"
  103.             ".ds f3 i\n"
  104.             ".ds f4 A\n"
  105.  
  106.             % Number registers for theorems
  107.             ".nr def 0\n"
  108.             ".nr prop 0\n"
  109.             ".nr lemma 0\n"
  110.             ".nr coroll 0\n"
  111.             ".nr proof 0\n"
  112.             ".nr theorem 0\n"
  113.  
  114.             % Reference commands
  115.  
  116. % redefine superscript strings so that refer tags look like [this]
  117.  
  118.             ".ds \[. \[\n"
  119.             ".ds .\] \]\n"
  120.  
  121. </qwertz>
  122.  
  123. % set initial level of headings, in register il
  124.  
  125. <article>        +    ".nr il 0"        +
  126. </article>    
  127.  
  128. <report>        +     ".nr il 1"        +
  129. </report>    +    ".bp\n"
  130.             ".rm LH\n.rm RH\n"
  131.             ".TC"            +
  132.  
  133. <book>        +    ".nr il 1"        +
  134. </book>        +    ".rm LH\n.rm RH\n"
  135.             ".bp\n"
  136.             ".TC"            +
  137.  
  138. <notes>        
  139. </notes>
  140.  
  141. <manpage>    +    ".nr il -1"        +
  142. </manpage>    
  143.  
  144. <titlepag>    
  145. </titlepag>
  146.  
  147. <title>        +    ".TL"            +
  148. </title>    
  149.  
  150. <subtitle>    +    ".br\n"
  151.             ".ft R\n"
  152.             ".SM"        +
  153. </subtitle>    +    ".LG"            +
  154.  
  155. <author>
  156. </author>
  157.  
  158. <name>        +    ".AU"            +
  159. </name>
  160.  
  161. <and>        
  162. </and>
  163.  
  164. <thanks>            "\\**\n"    
  165.             ".FS"            +
  166. </thanks>    +    ".FE"            +
  167.  
  168. <inst>        +    ".AI"            +
  169. </inst>
  170.  
  171. <newline>    +    ".br"            +
  172. </newline>
  173.  
  174. <label>        
  175. </label>    
  176.  
  177. <header>    
  178. </header>    
  179.  
  180. <lhead>        +    ".EH '"
  181. </lhead>        "'''"        +
  182.  
  183. <rhead>        +    ".OH '''"
  184. </rhead>        "'"            +
  185.  
  186. <comment>    +    "(*"    +
  187. </comment>    +    "*)"    +
  188.  
  189. <abstract>    +    ".AB"            +
  190. </abstract>    +    ".AE"            +
  191.  
  192. <appendix>    +     ".af H1 A"        +
  193. </appendix>
  194.  
  195. % limitation: no list of figures or tables.  A table of contents
  196. % is always generated for books and reports. Thus these next three tags
  197. % are no-ops
  198.  
  199. <toc>        
  200. </toc>
  201.  
  202. <lof>    
  203. </lof>
  204.  
  205. <lot>    
  206. </lot>
  207.  
  208. <chapt>        +    ".bp\n"    
  209.             ".NH \\n(il "        +
  210. </chapt>
  211.  
  212. <sect>        +    ".NH 1+\\n(il"         +
  213. </sect>
  214.  
  215. <sect1>        +    ".NH 2+\\n(il"     +
  216. </sect1>
  217.  
  218. <sect2>        +    ".NH 3+\\n(il"        +
  219. </sect2>
  220.  
  221. <sect3>        +    ".NH 4+\\n(il"        +
  222. </sect3>    
  223.  
  224. <sect4>        +    ".NH 5+\\n(il"        +
  225. </sect4>
  226.  
  227. <heading>        ".ds h "
  228. </heading>    +    "\\*h\n"
  229.             ".XS \\n%\n"
  230.             "\\*(SN \\*h\n"
  231.             ".XE\n"        
  232.             ".nr h 1\n"  % set heading flag to true
  233.  
  234. <p>        +    ".Pp"            +
  235. </p>
  236.  
  237. <itemize>    +    ".nr ll +1\n"       % increment list level
  238.             ".nr t\\n(ll 0\n"    % set type of level to itemize
  239. </itemize>    +    ".nr ll -1"    +  % decrement list level
  240.     
  241.  
  242. <enum>        +    ".nr ll +1\n"        % increment list level
  243.             ".nr el +1\n"        % increment enumeration level
  244.             ".nr t\\n(ll 1\n"   % set type of level to enum
  245.             ".nr e\\n(el 0 1\n" % initialize enumerator
  246.             ".af e\\n(el \\*(f\\n(el\n" % style of enumerator
  247.             ".if \\n(ll>1 .RS"  +
  248. </enum>        +    ".if \\n(ll>1 .RE\n"
  249.             ".br\n"            
  250.             ".nr el -1\n"        % decrement enumeration level
  251.             ".nr ll -1"    +   % decrement list level 
  252.  
  253. <descrip>    +    ".RS\n"
  254.             ".nr ll +1\n"        % increment list level
  255.             ".nr t\\n(ll 2\n"   % set type of level to descrip
  256. </descrip>    +    ".nr ll -1\n"        % decrement list level
  257.             ".RE"        +
  258.  
  259. % number register bi means "begin item".  Used in the .P macro to print
  260. % bullets or numbers at beginning of first paragraph of an item.
  261. % If bi=1 then the paragraph is the first one of the item.
  262.  
  263. <item>        +    ".nr bi 1\n.Pp"        +
  264. </item>    
  265.  
  266. <tag>        +    ".IP \"\\fB"
  267. </tag>            "\\fP\"\n"
  268.             ".nr bi 1"            +
  269.  
  270. <cite>        +    ".\[\n[ID]\n.\]"    +
  271. </cite>    
  272.  
  273. <ncite>        +    ".\[\n[ID]\n.\]\n([NOTE])"
  274. </ncite>
  275.  
  276. <footnote>        "\\**\n"
  277.             ".FS"            +
  278. </footnote>    +    ".FE"            +
  279.  
  280. <sq>            "\\*Q"
  281. </sq>            "\\*U"
  282.  
  283. <lq>        +    ".RS\n"
  284.             ".nr LL \\n(LL-\\n(PI"    +
  285. </lq>        +    ".nr LL \\n(LL+\\n(PI\n"
  286.             ".RE"            +
  287.  
  288. <em>            "\\fI"            
  289. </em>             "\\fP"            
  290.  
  291. <bf>            "\\fB"            
  292. </bf>            "\\fR"            
  293.  
  294. <it>            "\\fI"            
  295. </it>            "\\fR"        
  296.  
  297. <sf>            "\\fR"        
  298. </sf>            "\\fR"            
  299.  
  300. <sl>            "\\fI"        
  301. </sl>            "\\fR"            
  302.  
  303. <tt>            "\\fR"
  304. </tt>            "\\fR"
  305.  
  306.  
  307. <ref>            "??"
  308. </ref>
  309.  
  310. <pageref>        "??"
  311. </pageref>
  312.  
  313. <x>    
  314. </x>
  315.  
  316. <mc>            
  317. </mc>
  318.  
  319. <biblio>    +    ".\[\n"
  320.             "$LIST$\n"
  321.             ".\]"            +
  322. </biblio>
  323.  
  324. <code>        +    ".DS L\n"
  325.             ".hl\n"
  326.             ".ft R\n"
  327.              ".eo"            +
  328.  
  329. </code>        +    ".ec\n"
  330.             ".hl\n"
  331.             ".DE\n"
  332.             ".ft P\n"
  333.             ".LP"    + % continue previous paragraph
  334.  
  335. <verb>        +    ".DS L\n"
  336.             ".ft R\n"
  337.              ".eo"            +
  338.  
  339. </verb>        +    ".ec\n"
  340.             ".DE\n"
  341.             ".ft P\n"
  342.             ".LP"    +  % continue previous paragraph
  343.  
  344. % theorems and such
  345.  
  346. <def>        +    ".sp\n"
  347.             ".nr def \\n\[def\]+1\n"
  348.             ".B \"Definition \\n\[def\] \"" +
  349. </def>        +    ".ft P\n.sp"         +
  350.  
  351. <prop>        +    ".sp\n"
  352.             ".nr prop \\n\[prop\]+1\n"
  353.             ".B \"Proposition \\n\[prop\] \"" +
  354. </prop>        +    ".ft P\n.sp"         +
  355.  
  356.  
  357. <lemma>        +    ".sp\n"
  358.             ".nr lemma \\n\[lemma\]+1\n"
  359.             ".B \"Lemma \\n\[lemma\] \""    +
  360. </lemma>    +    ".ft P\n.sp"         +
  361.  
  362. <coroll>    +    ".sp\n"
  363.             ".nr coroll \\n\[coroll\]+1\n"
  364.             ".B \"Corolloary \\n\[coroll\] \"" +
  365. </coroll>    +    ".ft P\n.sp"         +
  366.  
  367. <proof>        +    ".sp\n"
  368.             ".nr proof \\n\[proof\]+1\n"
  369.             ".B \"Proof \\n\[proof\] \""    +
  370. </proof>    +    ".ft P\n.sp"         +
  371.  
  372. <theorem>    +    ".sp\n"
  373.             ".nr theorem \\n\[theorem\]+1\n"
  374.             ".B \"Theorem \\n\[theorem\] \"" +
  375. </theorem>    +    ".ft P\n.sp"         +
  376.  
  377. <thtag>        +     ".B\n("
  378. </thtag>        ")\n.I"            +
  379.  
  380. % mathematics -- this nroff version needs work.
  381.  
  382. <f>                    
  383. </f>            
  384.  
  385. <dm>        +    ".DS L"                +
  386. </dm>        +    ".DE"            +
  387.  
  388. <eq>        +    ".DS L"            +
  389. </eq>        +    ".DE"            +
  390.  
  391. <fr>            
  392. </fr>        
  393.  
  394. <nu>            "{"
  395. </nu>            "} over "
  396.  
  397. <de>            "{"
  398. </de>            "}"
  399.  
  400. <lim>            
  401. </lim>
  402.  
  403. <op>
  404. </op>
  405.  
  406. <ll>            " from {"
  407. </ll>            "}"
  408.  
  409. <ul>            " to {"
  410. </ul>            "}"
  411.  
  412. <opd>
  413. </opd>
  414.  
  415. <pr>            " prod "
  416. </pr>
  417.  
  418. <in>            " int "
  419. </in>
  420.  
  421. <sum>            " sum "
  422. </sum>        
  423.  
  424. % limitation: eqn only does square roots!
  425.  
  426. <root>            " sqrt {"
  427. </root>            "}"
  428.  
  429. <ar>        +    ".TS\n"
  430.             "center, tab(|) ;\n"
  431.             "[ca]."            +
  432. </ar>        +    ".TE"            +
  433.  
  434. <arr>           "\n"            
  435. </arr>
  436.  
  437. <arc>           "|"
  438. </arc>
  439.  
  440.  
  441. <sup>            " sup {"
  442. </sup>            "}"
  443.  
  444. <inf>            " sub {"
  445. </inf>            "}"
  446.  
  447.  
  448. <unl>            "{"
  449. </unl>            "} under "
  450.  
  451. <ovl>            "{"
  452. </ovl>            "} bar "
  453.  
  454. <rf>            " bold{"
  455. </rf>            "}"
  456.  
  457. <v>            "{"
  458. </v>            "} vec "
  459.  
  460. % limitation: no calligraphic characters, using helvetica italics instead.  Is there a better font?
  461.  
  462. <fi>            "\\fI"    
  463. </fi>            "\\fP"    
  464.  
  465. <phr>            " roman }"
  466. </phr>            "}"
  467.  
  468.  
  469. <tu>        +    ".br"        +
  470. </tu>
  471.  
  472. % figures
  473.  
  474. <figure>    % +    ".KF"            +
  475. </figure>    % +    ".KE"            +
  476.  
  477. <eps>        +      ".if t .PSPIC [file].ps\n"
  478.             ".if n .sp 4"          +
  479. </eps>                    
  480.                 
  481. % Are TeX units properly handled by this translation of ph?
  482.  
  483. <ph>        +    ".sp [VSPACE]"        +
  484. </ph>    
  485.  
  486. <caption>    +    ".sp\n.ce"        +
  487. </caption>
  488.  
  489. % tables
  490.  
  491. <table>        +    ".KF\n.R"        +
  492. </table>    +    ".KE"            +
  493.  
  494. <tabular>    +    ".TS\n"
  495.             "center, tab(|) ; \n"
  496.             "[ca]."            +
  497. </tabular>    +    ".TE"            +
  498.  
  499. <rowsep>        "\n"            +
  500. </rowsep>
  501.  
  502. <colsep>        "|"
  503. </colsep>
  504.  
  505. <hline>        +    "_"            +
  506. </hline>
  507.  
  508. <slides>    +     ".nr PS 18"        +
  509. </slides>
  510.  
  511. <slide>    
  512. </slide>    +    ".bp\n\\&"            +
  513.  
  514. % letters -- replacement for email, using mh format.
  515.  
  516. <letter>    +    ".nf"    +
  517. </letter>    +
  518.  
  519. <from>        +     "From: "
  520. <to>        +    "To: "
  521.  
  522. <address>    +    ".de Ad\n"
  523. </address>    +    ".."    +
  524.  
  525. <email>            " <"
  526. </email>        ">"
  527.  
  528. <subject>    +    "Subject: "
  529.  
  530. <sref>        +    "Sref: "
  531. <rref>        +    "In-Reply-To: "
  532.  
  533. <cc>        +    "cc: "
  534.  
  535. <opening>    +    ".fi\n.LP"    +
  536.  
  537. <closing>    +    ".LP"        +
  538.  
  539. <encl>        +    ".XP\n"
  540.             "encl: "
  541.  
  542. <ps>        +    ".LP\np.s."
  543.  
  544.  
  545. % end of roff replacement file
  546.  
  547.